﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace 验证注册页面
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        string Username;

        string Password;
        protected void Page_Load(object sender, EventArgs e)
        {


        }




        protected void CustomValidator2_ServerValidate(object source, ServerValidateEventArgs args)
        {
            if (args.Value == "admin")
            {
                CustomValidator2.IsValid = true;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {


            string Username = Request.QueryString["username"];
            string Password = Request.QueryString["password"];
            Response.Write(Username + "," + Password);

            if (Password1.Text == Password && Loading.Text == Username)
            {
                Literal1.Text = $"登入成功 <a href=\"WebForm3.aspx?username={Username}\">进入</a>";
            }
            else
            {
                Literal1.Text = "出错";
            }

        }
    }
}